package com.yunfei.bo;
import com.yunfei.core.utils.string.StringUtil;
import com.yunfei.entity.AcOperatorEntity;

/**
    * acOperator 实体类
    * Fri Feb 02 13:09:13 CST 2018 zhengyunfei
    */ 


public class AcOperatorBo implements java.io.Serializable{
	private String operatorId;
	private String userId;
	private String password;
	private String invalDate;
	private String operatorName;
	private String authMode;
	private String status;
	private String unlockTime;
	private String menuType;
	private String lastLogin;
	private String errCount;
	private String startDate;
	private String endDate;
	private String validTime;
	private String macCode;
	private String ipAddress;
	private String email;
	private String field;
	private String order;
   /**
		* 更改排序字段
		* @return
		*/
   public String getField() {
		   return field;
   }
   public void setField(String field) {
		   this.field = field;
   }
   public String getOrder() {
		   return order;
   }
   public void setOrder(String order) {
		   this.order = order;
   }
		private int curNo;
		public int getCurNo() {
		int value=(curNo-1)*curSize;
		return value;
	}	
	public void setCurNo(int curNo) {
		this.curNo = curNo;
	}
	private int curSize;
	   public int getCurSize() {
		   /**oracle分页形式，需要加下面这句话**/
		   int curSize=curNo*this.curSize;
		   return curSize;
	   }
	public void setCurSize(int curSize) {
		this.curSize = curSize;
	}
	public void setOperatorId(String operatorId){
		this.operatorId=operatorId;
	}
	public String getOperatorId(){
		return operatorId;
	}
	public void setUserId(String userId){
		this.userId=userId;
	}
	public String getUserId(){
		return userId;
	}
	public void setPassword(String password){
		this.password=password;
	}
	public String getPassword(){
		return password;
	}
	public void setInvalDate(String invalDate){
		this.invalDate=invalDate;
	}
	public String getInvalDate(){
		return invalDate;
	}
	public void setOperatorName(String operatorName){
		this.operatorName=operatorName;
	}
	public String getOperatorName(){
		return operatorName;
	}
	public void setAuthMode(String authMode){
		this.authMode=authMode;
	}
	public String getAuthMode(){
		return authMode;
	}
	public void setStatus(String status){
		this.status=status;
	}
	public String getStatus(){
		return status;
	}
	public void setUnlockTime(String unlockTime){
		this.unlockTime=unlockTime;
	}
	public String getUnlockTime(){
	if(!StringUtil.isNullOrEmpty(unlockTime)){
			unlockTime=unlockTime.replace(".0","");
		}
		return unlockTime;
	}
	public void setMenuType(String menuType){
		this.menuType=menuType;
	}
	public String getMenuType(){
		return menuType;
	}
	public void setLastLogin(String lastLogin){
		this.lastLogin=lastLogin;
	}
	public String getLastLogin(){
		return lastLogin;
	}
	public void setErrCount(String errCount){
		this.errCount=errCount;
	}
	public String getErrCount(){
		return errCount;
	}
	public void setStartDate(String startDate){
		this.startDate=startDate;
	}
	public String getStartDate(){
		return startDate;
	}
	public void setEndDate(String endDate){
		this.endDate=endDate;
	}
	public String getEndDate(){
		return endDate;
	}
	public void setValidTime(String validTime){
		this.validTime=validTime;
	}
	public String getValidTime(){
	if(!StringUtil.isNullOrEmpty(validTime)){
			validTime=validTime.replace(".0","");
		}
		return validTime;
	}
	public void setMacCode(String macCode){
		this.macCode=macCode;
	}
	public String getMacCode(){
		return macCode;
	}
	public void setIpAddress(String ipAddress){
		this.ipAddress=ipAddress;
	}
	public String getIpAddress(){
		return ipAddress;
	}
	public void setEmail(String email){
		this.email=email;
	}
	public String getEmail(){
		return email;
	}
	public static AcOperatorEntity boToEntity(AcOperatorBo bo){
		AcOperatorEntity entity=new AcOperatorEntity();
		entity.setOperatorId(bo.getOperatorId());
		entity.setUserId(bo.getUserId());
		entity.setPassword(bo.getPassword());
		entity.setInvalDate(bo.getInvalDate());
		entity.setOperatorName(bo.getOperatorName());
		entity.setAuthMode(bo.getAuthMode());
		entity.setStatus(bo.getStatus());
		entity.setUnlockTime(bo.getUnlockTime());
		entity.setMenuType(bo.getMenuType());
		entity.setLastLogin(bo.getLastLogin());
		entity.setErrCount(bo.getErrCount());
		entity.setStartDate(bo.getStartDate());
		entity.setEndDate(bo.getEndDate());
		entity.setValidTime(bo.getValidTime());
		entity.setMacCode(bo.getMacCode());
		entity.setIpAddress(bo.getIpAddress());
		entity.setEmail(bo.getEmail());
		return entity;
	}
	public static AcOperatorBo entityToBo(AcOperatorEntity bo){
		AcOperatorBo entity=new AcOperatorBo();
		entity.setOperatorId(bo.getOperatorId());
		entity.setUserId(bo.getUserId());
		entity.setPassword(bo.getPassword());
		entity.setInvalDate(bo.getInvalDate());
		entity.setOperatorName(bo.getOperatorName());
		entity.setAuthMode(bo.getAuthMode());
		entity.setStatus(bo.getStatus());
		entity.setUnlockTime(bo.getUnlockTime());
		entity.setMenuType(bo.getMenuType());
		entity.setLastLogin(bo.getLastLogin());
		entity.setErrCount(bo.getErrCount());
		entity.setStartDate(bo.getStartDate());
		entity.setEndDate(bo.getEndDate());
		entity.setValidTime(bo.getValidTime());
		entity.setMacCode(bo.getMacCode());
		entity.setIpAddress(bo.getIpAddress());
		entity.setEmail(bo.getEmail());
		return entity;
	}
	public static String changeFieldColumn(String field){
		String result="";
			if(!StringUtil.isNullOrEmpty(field)){
		if(field.equals("operatorId")){
			result="OPERATOR_ID";
		}
		if(field.equals("userId")){
			result="USER_ID";
		}
		if(field.equals("password")){
			result="PASSWORD";
		}
		if(field.equals("invalDate")){
			result="INVAL_DATE";
		}
		if(field.equals("operatorName")){
			result="OPERATOR_NAME";
		}
		if(field.equals("authMode")){
			result="AUTH_MODE";
		}
		if(field.equals("status")){
			result="STATUS";
		}
		if(field.equals("unlockTime")){
			result="UNLOCK_TIME";
		}
		if(field.equals("menuType")){
			result="MENU_TYPE";
		}
		if(field.equals("lastLogin")){
			result="LAST_LOGIN";
		}
		if(field.equals("errCount")){
			result="ERR_COUNT";
		}
		if(field.equals("startDate")){
			result="START_DATE";
		}
		if(field.equals("endDate")){
			result="END_DATE";
		}
		if(field.equals("validTime")){
			result="VALID_TIME";
		}
		if(field.equals("macCode")){
			result="MAC_CODE";
		}
		if(field.equals("ipAddress")){
			result="IP_ADDRESS";
		}
		if(field.equals("email")){
			result="EMAIL";
		}
		}
		return result;
	}
}

